import request from './request';
import env from './env';
/**
 * baseUrl: url头
 * url: 地址
 * method: 请求方法
 * params: 参数
 */
interface paramsType {
  baseUrl: string;
  url: string;
  method: string;
  params?: object;
}
export default function ({ baseUrl, url, method, params }: paramsType) {
  url = env[baseUrl] + url;
  let options = { method, data: params };
  return request(url, options);
}
